import request from '@/utils/ajax'

// 统一管理搜索相关的请求
// 请求热搜词的接口
export const reqGetHotWordList = () => request.get('/wy/xhr/search/init.json')


//实时搜索列表的请求   请求体为: keywordPrefix=${keywordPrefix}
export const reqGetTimeList = (data) => request.post('/wy/xhr/search/searchAutoComplete.json', data, {
  headers: {
    'content-type': 'application/x-www-form-urlencoded'
 }
})

// 产品列表的请求  参数为搜索的关键字
export const reqGetProductList = (keyWord)=> request.get(`/wy/xhr/search/search.json?__timestamp=1630133434953&needPopWindow=true&searchWordSource=7&stillSearch=false&_stat_search=autoComplete&itemId=0&size=40&upperPrice=-1&floorPrice=-1&matchType=0&categoryId=0&descSorted=false&sortType=0&keyword=${keyWord}`)
